import { start } from "nprogress";
import uuidv1 from "uuid/v1";

import cz from "./cz.json";
// import sy from "./sy.json";
// import lw from "./lw.json";
import PolylineTrailMaterialProperty from "../../../../components/zhuoseqi/caizhi";
import PolylineTrailMaterialProperty1 from "../../../../components/zhuoseqi/caizhi1";
import PolylineTrailMaterialProperty2 from "../../../../components/zhuoseqi/caizhi2";

let zz = {
  watch: {},
  data() {
    return {};
  },
  methods: {
    loadwallfanwei(wallpos) {
      let positions = [];
      let minimumHeights = [];
      let maximumHeights = [];

      var alp = 1;
      var num = 0;

      wallpos[0].map(item1 => {
        positions.push(Cesium.Cartesian3.fromDegrees(item1[0], item1[1], 0));
        minimumHeights.push(0.0);
        maximumHeights.push(15.0);
      });

      let material = new PolylineTrailMaterialProperty1(
        // new Cesium.CallbackProperty(function () {
        //                 if ((num % 2) === 0){
        //                     alp -=0.005;
        //                 }else {
        //                     alp +=0.005;
        //                 }

        //                 if (alp <= 0.3){
        //                     num++;
        //                 }else if (alp >= 1){
        //                     num++;
        //                 }
        //   return Cesium.Color.fromRandom().withAlpha(alp);
        //                 //entity的颜色透明 并不影响材质，并且 entity也会透明
        //             },false)

        Cesium.Color.fromRandom({
          alpha: 5.0
        }),
        5000,
        "/configuration/3d/t/color5.png",
        true,
        100
      );

      positions.reverse();

      this.viewer.entities.add({
        name: "动态立体墙",
        wall: {
          minimumHeights: new Cesium.CallbackProperty(e => {
            return minimumHeights;
          }, false),
          maximumHeights: new Cesium.CallbackProperty(e => {
            return maximumHeights;
          }, false),
          show: true,
          positions: positions,
          material: material
          // material: new Cesium.ImageMaterialProperty({
          //   image: "configuration/3d/t/color5.png",
          //   transparent: true,
          //   color: new Cesium.CallbackProperty(function () {
          //     if ((num % 2) === 0) {
          //       alp -= 0.005;
          //     } else {
          //       alp += 0.005;
          //     }

          //     if (alp <= 0.3) {
          //       num++;
          //     } else if (alp >= 1) {
          //       num++;
          //     }
          //     return Cesium.Color.WHITE.withAlpha(alp)
          //     //entity的颜色透明 并不影响材质，并且 entity也会透明
          //   }, false)
          // })
        }
      });
    },
    loadwallnormal(wallpos) {
      let positions = [];
      let minimumHeights = [];
      let maximumHeights = [];

      wallpos[0].map(item1 => {
        positions.push(Cesium.Cartesian3.fromDegrees(item1[0], item1[1], 0));
        minimumHeights.push(0.0);
        maximumHeights.push(10.0);
      });

      let material = new PolylineTrailMaterialProperty1(
        Cesium.Color.fromRandom({
          alpha: 3.5
        }),
        7000,
        // `/configuration/3d/t/LinkTrail.png`,
        // `/configuration/3d/t/LinkPulse.png`,
        `/configuration/3d/t/color${_.random(52, 52)}.png`,
        true,
        15
      );

      this.viewer.entities.add({
        name: "动态立体墙",
        wall: {
          minimumHeights: new Cesium.CallbackProperty(e => {
            return minimumHeights;
          }, false),
          maximumHeights: new Cesium.CallbackProperty(e => {
            return maximumHeights;
          }, false),
          show: true,
          positions: positions,
          material: material
        }
      });
    },

    loadguanwangzhu(wallpos) {
      function computeCircle(radius) {
        var positions = [];
        for (var i = 0; i < 360; i = i + 40) {
          var radians = Cesium.Math.toRadians(i);
          positions.push(
            new Cesium.Cartesian2(
              radius * Math.cos(radians),
              radius * Math.sin(radians)
            )
          );
        }
        return positions;
      }

      function getDistance(satrt, end) {
        var geodesic = new Cesium.EllipsoidGeodesic();
        geodesic.setEndPoints(satrt, end);
        var distance = geodesic.surfaceDistance;
        return distance;
      }

      let positions = [];

      wallpos = wallpos.reverse()
      

      wallpos.map(item1 => {
        positions.push(Cesium.Cartesian3.fromDegrees(item1[0], item1[1], 6));
      });

      let radius = _.random(1, 1);

      positions.reverse();

      this._viewer.entities.add({
        polylineVolume: {
          positions: positions,
          shape: computeCircle(radius * 2.0),
          material: Cesium.Color.fromCssColorString("#FFFF1F99")
        }
      });

      let distance = 0;
      for (let index = 1; index < positions.length; index++) {
        distance += getDistance(
          Cesium.Cartographic.fromCartesian(positions[index - 1]),
          Cesium.Cartographic.fromCartesian(positions[index])
        );
      }

      // let resdis = getDistance(Cesium.Cartographic.fromCartesian(positions[0]), Cesium.Cartographic.fromCartesian(positions[positions.length - 1]))

      let countnum = distance / 10 + 1;
      // let countnum = 50

      // this._viewer.entities.add({
      //   polylineVolume: {
      //     positions: positions,
      //     shape: computeCircle(radius * 10.0),
      //     material: new Cesium.PolylineTrailLinkMaterialProperty(
      //       // Cesium.Color.fromRandom(),
      //       Cesium.Color.YELLOW.withAlpha(10.0),
      //       // Cesium.Color.fromCssColorString('#' + _.random(0, 99) + _.random(0, 99) + _.random(0, 99)),
      //       _.random(3000, 5000),
      //       countnum.toFixed(1)
      //     )
      //   }
      // });

      let material = new PolylineTrailMaterialProperty2(
        Cesium.Color.fromCssColorString("#FFFF1F"),
        5000,
        "/configuration/3d/t/color5.png",
        true,
        countnum
      );

      this._viewer.entities.add({
        polylineVolume: {
          positions: positions,
          shape: computeCircle(radius * 2.1),
          material: material
        }
      });
    },

    loadguanwang(wallpos) {
      function computeCircle(radius) {
        var positions = [];
        for (var i = 0; i < 360; i = i + 40) {
          var radians = Cesium.Math.toRadians(i);
          positions.push(
            new Cesium.Cartesian2(
              radius * Math.cos(radians),
              radius * Math.sin(radians)
            )
          );
        }
        return positions;
      }

      function getDistance(satrt, end) {
        var geodesic = new Cesium.EllipsoidGeodesic();
        geodesic.setEndPoints(satrt, end);
        var distance = geodesic.surfaceDistance;
        return distance;
      }

      let positions = [];

      wallpos = wallpos.reverse()

      wallpos.map(item1 => {
        positions.push(Cesium.Cartesian3.fromDegrees(item1[0], item1[1], 5));
      });

      positions.reverse();

      let radius = _.random(1, 1);

      this._viewer.entities.add({
        polylineVolume: {
          positions: positions,
          shape: computeCircle(radius * 1.0),
          material: Cesium.Color.fromCssColorString("#77FFF799")
        }
      });

      for (let index = 1; index < positions.length; index++) {
        let dis = getDistance(
          Cesium.Cartographic.fromCartesian(positions[index - 1]),
          Cesium.Cartographic.fromCartesian(positions[index])
        );
        let countnum = dis / 10 + 1;

        let material = new PolylineTrailMaterialProperty2(
          Cesium.Color.fromCssColorString("#77FFF7"),
          1000,
          "/configuration/3d/t/color5.png",
          true,
          countnum
        );

        this._viewer.entities.add({
          polylineVolume: {
            positions: [positions[index - 1], positions[index]],
            shape: computeCircle(radius * 1.1),
            material: material
          }
        });
      }

      // let resdis = getDistance(Cesium.Cartographic.fromCartesian(positions[0]), Cesium.Cartographic.fromCartesian(positions[positions.length - 1]))

      // console.log(countnum);

      // if (countnum < 10) {
      // } else {
      //   countnum = countnum * 50
      //   let material = new PolylineTrailMaterialProperty(
      //     Cesium.Color.YELLOW.withAlpha(5.0),
      //     5000,
      //     "/configuration/3d/arrow2.png",
      //     true,
      //     countnum
      //   );

      //   this._viewer.entities.add({
      //     polylineVolume: {
      //       positions: positions,
      //       shape: computeCircle(radius * 5.0),
      //       material: material
      //     }
      //   });

      // }
    },

    czcameraAttachedClick() {
      this.czcameraAttached = !this.czcameraAttached;
      // 飞回原始位置
      if (!this.czcameraAttached) {
        this._earth.cameraViewManager.views[1].flyTo();
      }
    },

    changzhou() {
      let _this = this;

      this._earth.interaction.picking.enabled = true;
      this._earth.interaction.picking.clickedColor = [0.239, 0.823, 0.709, 1];
      this._earth.interaction.picking.hoverEnable = false
      // XE.cso.allowPicking = false

      // Cesium后处理
      var silhouetteBlue = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
      silhouetteBlue.uniforms.color = Cesium.Color.BLUE;
      silhouetteBlue.uniforms.length = 0.01;
      silhouetteBlue.selected = [];

      var silhouetteGreen = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
      silhouetteGreen.uniforms.color = Cesium.Color.LIME;
      silhouetteGreen.uniforms.length = 0.01;
      silhouetteGreen.selected = [];

      this._earth.czm.scene.postProcessStages.add(
        Cesium.PostProcessStageLibrary.createSilhouetteStage([
          silhouetteBlue,
          silhouetteGreen
        ])
      );


      let tile1 = this.$root._earth.sceneTree.$refs.tile1.czmObject;

      tile1.xbsjCustomShader.fsBody = `
        // 可以修改的参数
        // 注意shader中写浮点数是，一定要带小数点，否则会报错，比如0需要写成0.0，1要写成1.0
        float _baseHeight = 0.0; // 物体的基础高度，需要修改成一个合适的建筑基础高度
        float _heightRange = 30.0; // 高亮的范围(_baseHeight ~ _baseHeight + _heightRange) 默认是 0-60米
        float _glowRange = 50.0; // 光环的移动范围(高度)

        // 建筑基础色
        float vtxf_height = v_elevationPos.z - _baseHeight + 50.0;
        float vtxf_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;
        float vtxf_a12 = vtxf_height / _heightRange + sin(vtxf_a11) * 0.1;
        // gl_FragColor *= vec4(1.0, 1.0, 1.0, 1.0);
        gl_FragColor *= vec4(vtxf_a12, vtxf_a12, vtxf_a12, 1.0);

        // 动态光环
        float vtxf_a13 = fract(czm_frameNumber / 360.0);
        float vtxf_h = clamp(vtxf_height / _glowRange, 0.0, 1.0);
        vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;
        float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13));
        gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - vtxf_diff);
      `;

      //119.982687,31.939708
      // this._earth.camera.flyAround(
      //   [(120.000687 * Math.PI) / 180, (31.999708 * Math.PI) / 180, 6],
      //   30000,
      //   [(360.0 * Math.PI) / 180, (-22 * Math.PI) / 180, 0],
      //   0.5,
      //   0.1
      // );

      //加载三种材质

      // sy.geometries.map(item => {
      //   if (item.type == "Polygon" && item["coordinates"][0].length > 300) {
      //     let resw = [];
      //     item["coordinates"][0].map(item1 => {
      //       resw.push((item1[0] * Math.PI) / 180.0);
      //       resw.push((item1[1] * Math.PI) / 180.0);
      //     });

      //     this._earth.sceneTree.root.children.push({
      //       // ref: "water1",
      //       czmObject: {
      //         xbsjType: "Water",
      //         baseWaterColor: [0.0, 0.9, 0.0, 1.0],
      //         frequency: 5,
      //         outline: {
      //           show: false
      //         },
      //         positions: resw,
      //         height: 0.24
      //       }
      //     });
      //   }
      // });

      // let lines = [];
      // lw.geometries.map(item => {
      //   if (item.type == "LineString" && item["coordinates"].length > 0) {
      //     let resw = [];
      //     item["coordinates"].map(item1 => {
      //       resw.push([
      //         (item1[0] * Math.PI) / 180.0,
      //         (item1[1] * Math.PI) / 180.0
      //       ]);
      //     });

      //     lines.push({
      //       positions: resw,
      //       color: [
      //         Math.random() * 0.5 + 0.5,
      //         Math.random() * 0.8 + 0.2,
      //         0.0,
      //         1.0
      //       ],
      //       width: 3.0,
      //       startTime: 0,
      //       duration: 5
      //     });
      //   }
      // });

      // this._odlines = new XE.Obj.ODLines(this.earth);
      // this._odlines.translucentPass = false;
      // this._odlines.color = [1, 1, 1, 1];

      // this._odlines.data = lines;
      // this._odlines.timeDuration = 5;
      // this._odlines.playing = true;

      this.pinids = [];
      cz.features.map(item => {
        //判断点线面
        if (item.geometry.type == "Polygon") {
          if (item.properties.name && item.properties.name == "quyu") {
            //范围
            let wallpos = item.geometry.coordinates;
            this.loadwallfanwei(wallpos);
          } else {
            //供热区域
            let wallpos = item.geometry.coordinates;
            this.loadwallnormal(wallpos);
          }
        }

        if (item.geometry.type == "Point") {
          if (item.properties.name && item.properties.name == "reyuan") {
            //热源
            let wallpos = item.geometry.coordinates;
            let aaa = {
              position: [
                (wallpos[0] * Math.PI) / 180,
                (wallpos[1] * Math.PI) / 180,
                0
              ],
              scale: 5,
              name: "测试"
            };

            _this.markcz(aaa);

            _this._earth.sceneTree.root.children.push({
              czmObject: {
                xbsjType: "Model",
                scale: 0.5,
                xbsjGuid: "a7acb274-c535-4529-a7b3-dd60c436c552",
                name: "模型",
                color:
                  _.random(0, 1) == 0
                    ? [0, 0.486, 0.984, 1]
                    : [0.411, 0.894, 1, 1],
                url: "http://118.31.64.25:51920/model/cz/hrz.gltf",
                distanceDisplayCondition: [0, 50000000],
                silhouetteColor: [0, 0, 0, 1],
                luminanceAtZenith: 0,
                xbsjPosition: [
                  (wallpos[0] * Math.PI) / 180,
                  (wallpos[1] * Math.PI) / 180,
                  0
                ]
              }
            });
          } else {
            //热力站
            let wallpos = item.geometry.coordinates;
            let aaa = {
              position: [
                (wallpos[0] * Math.PI) / 180,
                (wallpos[1] * Math.PI) / 180,
                0
              ],
              scale: 2,
              name: "郑州热力",
              marklabel: true
            };

            let uuid = uuidv1()

            _this._earth.sceneTree.root.children.push({
              ref: uuid,
              czmObject: {
                xbsjType: "Tileset",
                xbsjGuid: "19b53518-59ff-4c6d-a0f8-46956812ea62",
                name: "新建模型服务",
                url: "http://118.31.64.25:51920/model/cz/bimhrz/tileset.json",
                xbsjPosition: aaa.position,
                xbsjScale: [1, 1, 1],
                xbsjUseOriginTransform: false,
                xbsjStyle: 'var style = {\n    color: "vec4(0, 0.5, 1.0,1)"\n}',
                xbsjClippingPlanes: {},
                xbsjCustomShader: {
                  fsBody:
                    "\n    // 可以修改的参数\n    // 注意shader中写浮点数是，一定要带小数点，否则会报错，比如0需要写成0.0，1要写成1.0\n    float _baseHeight = 0.0; // 物体的基础高度，需要修改成一个合适的建筑基础高度\n    float _heightRange = 10.0; // 高亮的范围(_baseHeight ~ _baseHeight + _heightRange) 默认是 0-60米\n    float _glowRange = 20.0; // 光环的移动范围(高度)\n\n    // 建筑基础色\n    float vtxf_height = v_elevationPos.z - _baseHeight + 5.0;\n    float vtxf_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;\n    float vtxf_a12 = vtxf_height / _heightRange + sin(vtxf_a11) * 0.1;\n    gl_FragColor *= vec4(vtxf_a12, vtxf_a12, vtxf_a12, 1.0);\n\n    // 动态光环\n    float vtxf_a13 = fract(czm_frameNumber / 360.0);\n    float vtxf_h = clamp(vtxf_height / _glowRange, 0.0, 1.0);\n    vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;\n    float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13));\n    gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - vtxf_diff);\n"
                }
              }
            });

            let tileset1 = this._earth.sceneTree.$refs[uuid].czmObject;

            tileset1.onclick = pickedObject => {
              if (
                !silhouetteBlue.selected ||
                silhouetteBlue.selected[0] !== pickedObject
              ) {
                silhouetteBlue.selected = [pickedObject];
              }
              this.$message.success(pickedObject.getProperty("name"));
            }

            tileset1.onclickout = () => {
              if (silhouetteBlue.selected && silhouetteBlue.selected.length > 0) {
                silhouetteBlue.selected = [];
              }
      
              // return false; 是否禁用点选效果？
            };
      
            tileset1.onmouseover = pickedObject => {
              if (
                !silhouetteGreen.selected ||
                silhouetteGreen.selected[0] !== pickedObject
              ) {
                silhouetteGreen.selected = [pickedObject];
              }
              // return false; 是否禁用点选效果？
            };
      
            tileset1.onmouseout = () => {
              if (silhouetteGreen.selected && silhouetteGreen.selected.length > 0) {
                silhouetteGreen.selected = [];
              }
              // return false; 是否禁用点选效果？
            };





            let label = {
              label: {
                position: [
                  (wallpos[0] * Math.PI) / 180,
                  (wallpos[1] * Math.PI) / 180,
                  250
                ],
                rotation: [0, 0, 0]
              }
            };
            // this.paintlabel(label, 10);
            // this.createGroundChart(this.$root._earth, [
            //   (wallpos[0] * Math.PI) / 180,
            //   (wallpos[1] * Math.PI) / 180,
            //   0
            // ],[300,300]);
            // _this.markcz(aaa);
          }
        }

        if (item.geometry.type == "LineString") {
          if (item.properties.name && item.properties.name == "reyuan") {
            //主管网
            let wallpos = item.geometry.coordinates;
            this.loadguanwangzhu(wallpos);
          } else {
            //管网
            let wallpos = item.geometry.coordinates;
            this.loadguanwang(wallpos);
          }
        }
      });

      // 监控数据

      this.loadloudong();

      //加载管网

      //三种材质

      //加载路网

      //加载动态立体墙

      //加载
    },
    loadloudong() {
      let aaa = [
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.91783142089844, 31.948812157858953]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.91714477539064, 31.932642662392993]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.94255065917967, 31.910204597744382]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.94461059570311, 31.929583248656964]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.94564056396484, 31.950851351639255]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.9461555480957, 31.96905643253628]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.96864318847656, 31.96512444064522]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.96847152709961, 31.948375181874482]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.96726989746094, 31.92914618124109]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.96675491333008, 31.911516063811103]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.99198913574217, 31.949686103592832]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.99250411987303, 31.930748751608537]
        //   }
        // },
        // {
        //   type: "Feature",
        //   properties: {},
        //   geometry: {
        //     type: "Point",
        //     coordinates: [119.99130249023436, 31.911516063811103]
        //   }
        // }
      ];

      let wallpos = [119.99250411987303, 31.930748751608537];

      this.createGroundChartStatic(
        this.$root._earth,
        [
          ((wallpos[0] + 0.005) * Math.PI) / 180,
          ((wallpos[1] + 0.005) * Math.PI) / 180,
          0
        ],
        [1000, 1000]
      );

      // wallpos = [119.99250411987303, 31.930748751608537];

      // this.earth.sceneTree.root.children.push({
      //   ref: "billboard",
      //   czmObject: {
      //     xbsjType: "CustomPrimitive",
      //     xbsjGuid: "2812b3dc-1584-4ad3-8023-debe334b2817",
      //     evalString:
      //       "Cesium.Resource.createIfNeeded('./assets/city/billboard.png').fetchImage().then(function(image) { p.drawCanvas(ctx => {ctx.clearRect(0, 0, 512, 256); ctx.drawImage(image, 0, 0);}); });",
      //     position: [2.174033927183021, 0.10999357244211576, 0],
      //     scale: [1, 100, 50],
      //     positions: [
      //       0,
      //       -1,
      //       0,
      //       0,
      //       1,
      //       0,
      //       0,
      //       1,
      //       2,
      //       0,
      //       -1,
      //       2,
      //       0,
      //       1,
      //       0,
      //       0,
      //       -1,
      //       0,
      //       0,
      //       -1,
      //       2,
      //       0,
      //       1,
      //       2
      //     ],
      //     sts: [0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1],
      //     indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7],
      //     renderState: {
      //       cull: {
      //         enabled: true
      //       },
      //       polygonOffset: {},
      //       scissorTest: {
      //         rectangle: {}
      //       },
      //       depthRange: {},
      //       depthTest: {
      //         enabled: true
      //       },
      //       colorMask: {},
      //       depthMask: false,
      //       blending: {
      //         enabled: true,
      //         color: {},
      //         equationRgb: 32774,
      //         equationAlpha: 32774,
      //         functionSourceRgb: 770,
      //         functionDestinationRgb: 771,
      //         functionDestinationAlpha: 771
      //       },
      //       stencilTest: {
      //         frontOperation: {},
      //         backOperation: {}
      //       },
      //       sampleCoverage: {}
      //     },
      //     color: [1, 1, 1, 1],
      //     canvasWidth: 1024,
      //     canvasHeight: 512,
      //     autoRegisterEditing: true
      //   }
      // });

      // var p = this.earth.sceneTree.$refs.billboard.czmObject;

      // this.createcpChartStatic(
      //   p,
      //   [
      //     ((wallpos[0] + 0.005) * Math.PI) / 180,
      //     ((wallpos[1] + 0.005) * Math.PI) / 180,
      //     0
      //   ],
      //   [1000, 1000]
      // );

      aaa.map(item => {
        for (let x = 0; x < 5; x++) {
          for (let y = 0; y < 4; y++) {
            this._earth.sceneTree.root.children.push({
              czmObject: {
                xbsjType: "Model",
                xbsjGuid: "a7acb274-c535-4529-a7b3-dd60c436c552",
                name: "模型",
                url: "http://118.31.64.25:51920/model/cz/xq.gltf",
                distanceDisplayCondition: [0, 50000000],
                // silhouetteColor: [0, 0, 0, 1],
                color:
                  _.random(0, 1) == 0
                    ? [0, 0.486, 0.984, 1]
                    : [0.411, 0.894, 1, 1],
                luminanceAtZenith: 0,
                scale: 3,
                xbsjPosition: [
                  ((item.geometry.coordinates[0] + 0.0025 * x + 0.001) *
                    Math.PI) /
                    180,
                  ((item.geometry.coordinates[1] + 0.0025 * y + 0.001) *
                    Math.PI) /
                    180,
                  0
                ],
                xbsjRotation: [(_.random(0, 360) * Math.PI) / 180, 0, 0]
              }
            });
          }
        }
      });
    }
  }
};

export default zz;
